package xfuzzy.alg_genetico.indeterminado.xfghlOld.model;

import java.io.File;
import java.util.Random;

import xfuzzy.alg_genetico.indeterminado.xfghlOld.model.spec.XfghlInputType;
import xfuzzy.alg_genetico.indeterminado.xfghlOld.model.spec.XfghlOperSet;

public class PruebaOrdenacion {
	
    public static void main(String[] args) {

		//Incializamos el random
		XfghlSinglRandom.initialize(43883892);		
		
		/**QUAKE 3 variables de entrada*/
		File file=new File("C:\\Documents and Settings\\Sergio\\Desktop\\XFGHL\\dee.dat");
		String name="Dee";
			
		int numEpocas=50;
	    	
		Random r=XfghlSinglRandom.getRandom();
	XfghlConfig config=new XfghlConfig(name,numEpocas,3,file,0.1,1.5,0.7,XfghlOperSet.AndOperatorProd,XfghlOperSet.DefuzOperatorFuzzyMean,XfghlInputType.FREE_TRIANGLES,3,0,6,50,0.3,0.1);		
	
	XfghlGeneration pob=new XfghlGeneration(config,true);	
		    
	for (XfghlChromosome c : pob.getChromosomes()) {
		
		c.setFinalError(r.nextFloat());
		System.out.println(c.toString2()+". Error: "+c.getFinalError());
	}

	pob.orderPoblation();	
	System.out.println("_____________________________________________");
	for (XfghlChromosome c : pob.getChromosomes()) {
				
		System.out.println(c.toString2()+". Error: "+c.getFinalError());
	}

	//Obtenemos un cromosoma aleatoriamente
	XfghlChromosome cRamdon=pob.getRandomChromosome();
	cRamdon.toString();
	
	
    }
}

